package com.qfmy.web.app.mapper.novel;

import com.qfmy.model.entity.novel.NovelCategory;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 清风明月
 * @Package com.qfmy.web.app.mapper.novel
 * @date 2025/10/31
 * @description 小说类型mapper
 */
@Mapper
@SuppressWarnings("all")
public interface NovelCategoryMapper {

    /**
     * 获取所有小说类型
     * @return
     */
    List<NovelCategory> getAllCategoryName();

    /**
     * 根据类型获取小说类型
     * @param type
     * @return
     */
    List<NovelCategory> getCategoryNameByType(Integer type);

    /**
     * 根据类型获取小说类型id
     * @param type
     * @return
     */
    @Select("select category_id from novel_category where type = #{type}")
    List<Long> getCategoryIdsByType(Integer type);

    /**
     * 根据类型获取小说类型名称
     * @param type
     * @return
     */
    @Select("select category_name from novel_category where type = #{type}")
    List<String> getCategoryNamesByType(Integer type);
}
